package com.jianggy.proxy.jdk1;

import java.lang.reflect.InvocationHandler;
import java.lang.reflect.Method;

public class DaoProxyHandler implements InvocationHandler {
	private Object dao;

	public DaoProxyHandler(Object dao) {
		this.dao = dao;
	}

	@Override
	public Object invoke(Object proxy, Method method, Object[] args) throws Throwable {
		System.out.println("开始事务.....");
		Object res = method.invoke(dao, args);
		System.out.println("提交事务......--");
		return res;
	}

}
